<%= javascript_include_tag 'pagination' %>

<div class="portlet">
  <div class="portlet-header">
    <h1><%=t ".title"%></h1>
  </div>

  <div class="portlet-content">
    <% form_tag my_wish_lists_path, :method => 'get' do %>
      <table style="border:0px">
        <tr>
          <th> <%= label_tag t('.lbl_wish_list_search') %> </th>
          <th align="left"> <%= select_tag(:wish_list_selected, options_for_select(@search_wish_lists, session[:wish_list_selected].to_i)) %>
          </th>
        </tr>
        <tr>
          <th></th>
          <th align="left">
            <%= link_to t('btn_edit'), my_wish_list_edit_path %> |            
            <%= link_to t('btn_destroy'), {:action => 'destroy'}, :confirm => t('msg_sure_destroy?'), :method => :delete %> |
            <%= link_to t('.btn_add_wish_list'), new_my_wish_list_path %>
          </th>
        </tr>
        <tr><th> </th></tr>
        <tr>
          <th> <%= label_tag t('.lbl_material_search') %> </th>
          <th align="left"> <%= text_field_tag :search_material_title, session[:search_material_title], :size => 30 %> </th>
        </tr>
      </table>
    <% end %>

    <%= observe_field :wish_list_selected,
      :frequency => 0.5,      
      :url => {:controller => :my_wish_lists, :action => :observer_wish_list_selected_search},
      :update => "wish_list_materials",
      :with => "'wish_list_selected='+ escape($('wish_list_selected').value) + '&search_material_title=' + escape($('search_material_title').value)"
      %>

    <%= observe_field :search_material_title,
      :frequency => 0.5,
      :url => {:controller => :my_wish_lists, :action => :observer_materials_search},
      :update => "wish_list_materials",
      :with => "'wish_list_selected='+ escape($('wish_list_selected').value) + '&search_material_title=' + escape($('search_material_title').value)"
      %>


    <div id="wish_list_materials">
      <%= render :partial=>'wish_list_materials' , :layout=>false %>
    </div>    
  </div>
  
  <div class="portlet-footer">
  </div>
</div>


